<template>
  <div class="_videoList">
    <van-cell
      v-for="(item,index) in videoArr"
      :key="index"
      :title="item.name"
      is-link
      @click="cellClick(item,index)"
    ></van-cell>
  </div>
</template>

<script>
import { Cell, Dialog } from "vant";
import { videoList } from "@/config/videoList";
import qs from "qs";
export default {
  components: {
    [Cell.name]: Cell
  },
  data() {
    return {
      videoArr: videoList
    };
  },
  computed: {
    shareParams() {
      return this.$store.state.shareParams;
    }
  },
  mounted() {},
  methods: {
    cellClick(item, index) {
      if (this.shareParams.shareId) {
        let url1 = window.location.href.split("#")[0];
        let param = qs.parse(url1.split("?")[1]);
        param.shareId = this.shareParams.shareId;
        param.vid = index;
        console.log(param);
        let url = qs.stringify(param);
        console.log(url);
        let link = `http://app.aptenon.com/crm/dist/activity.html?${url}#/activityPage7/playVideo`;
        console.log(link);
        window.location.href = link;
      } else {
        Dialog.alert({ message: "获取分享信息失败" });
      }
    }
  }
};
</script>

<style lang="scss">
._videoList {
  height: 100vh;
  background-color: #eee;
  box-sizing: border-box;
}
</style>